package com.ssm.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.ssm.service.CaseObjService;

/**
 * 实现用例的增删改查
 */
@RestController
@RequestMapping("case")
public class CaseController {
	
    private Logger logger = Logger.getLogger(CaseController.class);

    @Autowired
    private CaseObjService caseInfoService;
    
    @RequestMapping(value="baseinfo", method = RequestMethod.POST, consumes="application/json")
    @ResponseBody
    public Object getBaseInfoByCondition(@RequestBody JSONObject paramJson){
    	
    	logger.debug("getBaseInfoByCondition: " + paramJson.toJSONString());
    	
        return caseInfoService.getZTreeData(paramJson);
    }
    
    @RequestMapping(value="detail", method = RequestMethod.POST, consumes="application/json")
    @ResponseBody
    public Object getCaseDetail(@RequestBody JSONObject paramJson){
    	
    	logger.debug("getCaseDetail: " + paramJson.toJSONString());
    	
        return caseInfoService.getCaseDetail(paramJson);
    }
}
